/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.f1x.api.message.fields;

// Generated by org.f1x.tools.DictionaryGenerator from QuickFIX dictionary
public enum QuoteEntryRejectReason implements org.f1x.api.message.types.ByteEnum {
	UNKNOWN_SYMBOL((byte)'1'),
	EXCHANGE_CLOSED((byte)'2'),
	QUOTE_EXCEEDS_LIMIT((byte)'3'),
	TOO_LATE_TO_ENTER((byte)'4'),
	UNKNOWN_QUOTE((byte)'5'),
	DUPLICATE_QUOTE((byte)'6'),
	INVALID_BID_ASK_SPREAD((byte)'7'),
	INVALID_PRICE((byte)'8'),
	NOT_AUTHORIZED_TO_QUOTE_SECURITY((byte)'9');

	private final byte code;

	QuoteEntryRejectReason (byte code) {
		this.code  = code;
	}

	public byte getCode() { return code; }

	public static QuoteEntryRejectReason parse(String s) {
		switch(s) {
			case "1" : return UNKNOWN_SYMBOL;
			case "2" : return EXCHANGE_CLOSED;
			case "3" : return QUOTE_EXCEEDS_LIMIT;
			case "4" : return TOO_LATE_TO_ENTER;
			case "5" : return UNKNOWN_QUOTE;
			case "6" : return DUPLICATE_QUOTE;
			case "7" : return INVALID_BID_ASK_SPREAD;
			case "8" : return INVALID_PRICE;
			case "9" : return NOT_AUTHORIZED_TO_QUOTE_SECURITY;
		}
		return null;
	}

}